package com.ruoyi.system.service.impl;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.ruoyi.system.domain.DdAddress;
import com.ruoyi.system.mapper.DdAddressMapper;
import com.ruoyi.system.service.DdAddressService;

import java.util.List;

@Service
public class DdAddressServiceImpl implements DdAddressService{

    @Resource
    private DdAddressMapper ddAddressMapper;


    /**
     * 查询地址列表
     * @param UID 用户id
     * @param sOrT s_or_t
     * @return
     */
    @Override
    public List<DdAddress> selectByUID(String UID, String sOrT){
        DdAddress address = new DdAddress();
        address.setUserId(UID);
        address.setsOrT(sOrT);
        return ddAddressMapper.selectByUID(address);
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        DdAddress ddAddress = new DdAddress();
        ddAddress.setId(id);
        ddAddress.setDef("1");
        return ddAddressMapper.updateByPrimaryKey(ddAddress);
    }

    @Override
    public int insert(DdAddress record) {
        return ddAddressMapper.insert(record);
    }

    @Override
    public int insertSelective(DdAddress record) {
        return ddAddressMapper.insertSelective(record);
    }

    @Override
    public DdAddress selectByPrimaryKey(Integer id) {
        return ddAddressMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(DdAddress record) {
        return ddAddressMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(DdAddress record) {
        return ddAddressMapper.updateByPrimaryKey(record);
    }

}
